<ion-header-bar class="bar-top text-center">
    <h1 class="title">最近咨询</h1>
</ion-header-bar>
<ion-view>
    <ion-content class="chat recent-chat" scroll="false">
        <div class="check-box">
            <ion-scroll>
                <ion-refresher
                    pulling-text="下拉刷新"
                    on-refresh="vm.doRefresh()"></ion-refresher>
                <ion-list class="recent-chat-list" >
                    <ion-item class='item-remove-animate' ng-repeat="d in vm.tabList" ng-click="toChat(d)">
                        <div class="row">
                            <div class="" style="width:72px !important;">
                                <img ng-if="vm.condition.fromUser" ng-src="{{downloadImg(d.toUserHeadImgUrl)}}" alt="" class="avatar">
                                <img ng-if="vm.condition.toUser" ng-src="{{downloadImg(d.fromUserHeadImgUrl)}}" alt="" class="avatar"></div>
                            <div class="col col-60">
                                <div ng-if="vm.condition.fromUser" class="name" ng-bind="d.toUserName"></div>
                                <div ng-if="vm.condition.toUser" class="name" ng-bind="d.fromUserName"></div>
                                <div class="content" ng-bind="d.lastCallMsg.content"></div>
                            </div>
                            <div class="col col-15 op"> <i class="status" ng-class="{'over':d.state==2}" ng-bind='(d.state==0?"启动":d.state==1?"回复中":"结束")'></i> 
                            <i ng-show="d.fromUserUnread>0&&vm.condition.fromUser" class="flag" ng-bind="d.fromUserUnread"></i>
                            <i ng-show="d.toUserUnread>0&&vm.condition.toUser" class="flag" ng-bind="d.toUserUnread"></i>
                            </div>
                        </div>
                        <ion-option-button class="button-assertive"
                                           ng-click="delete(d)">
                          删除
                        </ion-option-button>
                    </ion-item>
                </ion-list>
                <ion-infinite-scroll
                    ng-if="!vm.nodata"
                    on-infinite="vm.loadMore()"
                    distance="1%"></ion-infinite-scroll>
            </ion-scroll>
        </div>
    </ion-content>
</ion-view>